package com.shine.design.pattern.guide.singleton.demo0;


/**
 * @Description: 懒汉式单例模式测试
 * @CreateTime: 2023/8/27 12:32
 * @Version:
 * @Since: 1.8
 * @Author: Forward Seen
 */
public class SingletonTest {
    @org.junit.Test
    public void getSingleton(){
        Singleton s1 = Singleton.getInstance();
        Singleton s2 = Singleton.getInstance();
        //比较内存地址是否为同一个
        System.out.println(s1 == s2); //true
    }
}